home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / hf^k-2.dms / in.adf / MUIClass.Lha / Include / Classes / TWiMUI / Group.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-06  |  5.4 KB  |  162 lines

  1. //
  2. //  $VER: Group.h       1.2 (02 Sep 1996)
  3. //
  4. //    c 1996 Thomas Wilhelmi
  5. //
  6. //
  7. // Address : Taunusstrasse 14
  8. //           61138 Niederdorfelden
  9. //           Germany
  10. //
  11. //  E-Mail : willi@twi.rhein-main.de
  12. //
  13. //   Phone : +49 (0)6101 531060
  14. //   Fax   : +49 (0)6101 531061
  15. //
  16. //
  17. //  $HISTORY:
  18. //
  19. //  16 Jun 1996 :   1.0 : first public Release
  20. //
  21. //  27 Jul 1996 :   1.1 : Bug Fixes:
  22. //                        - MUIGroupH::MUIGroupH();
  23. //                          MUIGroupV::MUIGroupV();
  24. //                          MUIGroupCol::MUIGroupCol(const LONG);
  25. //                          MUIGroupRow::MUIGroupRow(const LONG);
  26. //                          Bei diesen Konstruktoren war ein Fehler der dazu führte, daß
  27. //                          die Methode Create() die falschen parameter bekam.
  28. //                        Änderungen:
  29. //                        - Add(), Rem()
  30. //                          Der Parameter wurde von 'MUIGroup &' auf 'Object *' geändert.
  31. //
  32. //  02 Sep 1996 :   1.2 : Bug Fixes:
  33. //                        - MUIGroupH::MUIGroupH();
  34. //                          MUIGroupV::MUIGroupV();
  35. //                          MUIGroupCol::MUIGroupCol(const LONG);
  36. //                          MUIGroupRow::MUIGroupRow(const LONG);
  37. //                          Die Konstruktoren mit Parameter 'struct TagItem *' und NULL
  38. //                          als Wert hatten TAG_MORE mit NULL als Zeiger.
  39. //                        Neu:
  40. //                        - Die Methode Sort() wurde für MUI 3.6 hinzugefügt.
  41. //                        - ClassNum() für Exception-Handling.
  42. //                        Änderungen
  43. //                        - Parameter des Copy-Konstruktor als 'const'-Parameter definiert
  44. //
  45.  
  46. #ifndef CPP_TWIMUI_GROUP_H
  47. #define CPP_TWIMUI_GROUP_H
  48.  
  49. #ifndef CPP_TWIMUI_AREA_H
  50. #include <classes/twimui/area.h>
  51. #endif
  52.  
  53. #ifndef EXEC_LISTS_H
  54. #include <exec/lists.h>
  55. #endif
  56.  
  57. #ifndef UTILITY_HOOKS_H
  58. #include <utility/hooks.h>
  59. #endif
  60.  
  61. class MUIGroupLayoutHook
  62.     {
  63.     private:
  64.         struct Hook layouthook;
  65.         static ULONG LayoutHookEntry(register __a0 struct Hook *, register __a2 Object *, register __a1 struct MUI_LayoutMsg *);
  66.         virtual ULONG LayoutHookFunc(struct Hook *, Object *, struct MUI_LayoutMsg *);
  67.     protected:
  68.         MUIGroupLayoutHook();
  69.         MUIGroupLayoutHook(const MUIGroupLayoutHook &p);
  70.         ~MUIGroupLayoutHook();
  71.         MUIGroupLayoutHook &operator= (const MUIGroupLayoutHook &);
  72.     public:
  73.         struct Hook *layout() { return(&layouthook); };
  74.     };
  75.  
  76. class MUIGroup
  77.     :   public MUIArea,
  78.         public MUIGroupLayoutHook
  79.     {
  80.     protected:
  81.         virtual const ULONG ClassNum() const;
  82.         MUIGroup(const STRPTR cl)
  83.             :   MUIArea(cl),
  84.                 MUIGroupLayoutHook()
  85.             { };
  86.     public:
  87.         MUIGroup(const struct TagItem *t)
  88.             :   MUIArea(MUIC_Group),
  89.                 MUIGroupLayoutHook()
  90.             { init(t); };
  91.         MUIGroup(const Tag, ...);
  92.         MUIGroup()
  93.             :   MUIArea(MUIC_Group),
  94.                 MUIGroupLayoutHook()
  95.             { };
  96.         MUIGroup(const MUIGroup &);
  97.         virtual ~MUIGroup();
  98.         MUIGroup &operator= (const MUIGroup &);
  99.         void ActivePage(const LONG p) { set(MUIA_Group_ActivePage,(ULONG)p); };
  100.         void ActivePageFirst() { set(MUIA_Group_ActivePage,MUIV_Group_ActivePage_First); };
  101.         void ActivePageLast() { set(MUIA_Group_ActivePage,MUIV_Group_ActivePage_Last); };
  102.         void ActivePagePrev() { set(MUIA_Group_ActivePage,MUIV_Group_ActivePage_Prev); };
  103.         void ActivePageNext() { set(MUIA_Group_ActivePage,MUIV_Group_ActivePage_Next); };
  104.         LONG ActivePage() const { return((LONG)get(MUIA_Group_ActivePage,0L)); };
  105.         struct List *ChildList() const { return((struct List *)get(MUIA_Group_ChildList,NULL)); };
  106.         void Columns(const LONG p) { set(MUIA_Group_Columns,(ULONG)p); };
  107.         void HorizSpacing(const LONG p) { set(MUIA_Group_HorizSpacing,(ULONG)p); };
  108.         void Rows(const LONG p) { set(MUIA_Group_Rows,(ULONG)p); };
  109.         void VertSpacing(const LONG p) { set(MUIA_Group_VertSpacing,(ULONG)p); };
  110.         void ExitChange() { dom(MUIM_Group_ExitChange,0); };
  111.         APTR InitChange() { return((APTR)dom(MUIM_Group_InitChange,0)); };
  112.         void Sort(Object *, ...);
  113.         void Add(Object *p) { dom(OM_ADDMEMBER,(ULONG)p); };
  114.         void Rem(Object *p) { dom(OM_REMMEMBER,(ULONG)p); };
  115.     };
  116.  
  117. class MUIGroupV : public MUIGroup
  118.     {
  119.     public:
  120.         MUIGroupV(const struct TagItem *);
  121.         MUIGroupV(const Tag, ...);
  122.         MUIGroupV() : MUIGroup() { Tags.append(MUIA_Group_Horiz,FALSE,TAG_DONE); };
  123.         MUIGroupV(const MUIGroupV &p) : MUIGroup((MUIGroup &)p) { };
  124.         virtual ~MUIGroupV();
  125.         MUIGroupV &operator= (const MUIGroupV &);
  126.     };
  127.  
  128. class MUIGroupH : public MUIGroup
  129.     {
  130.     public:
  131.         MUIGroupH(const struct TagItem *);
  132.         MUIGroupH(const Tag, ...);
  133.         MUIGroupH() : MUIGroup() { Tags.append(MUIA_Group_Horiz,TRUE,TAG_DONE); };
  134.         MUIGroupH(const MUIGroupH &p) : MUIGroup((MUIGroup &)p) { };
  135.         virtual ~MUIGroupH();
  136.         MUIGroupH &operator= (const MUIGroupH &);
  137.     };
  138.  
  139. class MUIGroupCol : public MUIGroup
  140.     {
  141.     public:
  142.         MUIGroupCol(const LONG c, const struct TagItem *);
  143.         MUIGroupCol(const LONG, const Tag, ...);
  144.         MUIGroupCol(const LONG c = 0) : MUIGroup() { Tags.append(MUIA_Group_Columns,c,TAG_DONE); };
  145.         MUIGroupCol(const MUIGroupCol &p) : MUIGroup((MUIGroup &)p) { };
  146.         virtual ~MUIGroupCol();
  147.         MUIGroupCol &operator= (const MUIGroupCol &);
  148.     };
  149.  
  150. class MUIGroupRow : public MUIGroup
  151.     {
  152.     public:
  153.         MUIGroupRow(const LONG r, const struct TagItem *);
  154.         MUIGroupRow(const LONG, const Tag, ...);
  155.         MUIGroupRow(const LONG r = 0) : MUIGroup() { Tags.append(MUIA_Group_Rows,r,TAG_DONE); };
  156.         MUIGroupRow(const MUIGroupRow &p) : MUIGroup((MUIGroup &)p) { };
  157.         virtual ~MUIGroupRow();
  158.         MUIGroupRow &operator= (const MUIGroupRow &p);
  159.     };
  160.  
  161. #endif
  162.